<template>
  <div class="quick-tools">
    <h2 class="section-title">快捷工具</h2>
    <div class="tools-grid">
      <router-link to="/asset" class="tool-item">
        <div class="tool-icon asset-icon">
          <i class="fas fa-laptop"></i>
        </div>
        <div class="tool-name">资产查询</div>
      </router-link>
      
      <router-link to="/asset/apply" class="tool-item">
        <div class="tool-icon apply-icon">
          <i class="fas fa-hand-holding"></i>
        </div>
        <div class="tool-name">资产申请</div>
      </router-link>
      
      <router-link to="/material" class="tool-item">
        <div class="tool-icon material-icon">
          <i class="fas fa-boxes"></i>
        </div>
        <div class="tool-name">物资查询</div>
      </router-link>
      
      <router-link to="/material/outbound" class="tool-item">
        <div class="tool-icon outbound-icon">
          <i class="fas fa-sign-out-alt"></i>
        </div>
        <div class="tool-name">物资出库</div>
      </router-link>
      
      <router-link to="/material/analytics" class="tool-item">
        <div class="tool-icon analytics-icon">
          <i class="fas fa-chart-bar"></i>
        </div>
        <div class="tool-name">物资分析</div>
        <div class="tool-badge" v-if="warningCount > 0">{{ warningCount }}</div>
      </router-link>
      
      <router-link to="/material/category" class="tool-item">
        <div class="tool-icon category-icon">
          <i class="fas fa-tags"></i>
        </div>
        <div class="tool-name">分类管理</div>
      </router-link>
      
      <router-link to="/asset/repair" class="tool-item">
        <div class="tool-icon repair-icon">
          <i class="fas fa-tools"></i>
        </div>
        <div class="tool-name">资产维修</div>
      </router-link>
      
      <router-link to="/asset/transfer" class="tool-item">
        <div class="tool-icon transfer-icon">
          <i class="fas fa-exchange-alt"></i>
        </div>
        <div class="tool-name">资产转移</div>
      </router-link>
    </div>
  </div>
</template>

<script>
export default {
  name: 'QuickTools',
  data() {
    return {
      warningCount: 7 // 模拟物资预警数量
    }
  }
}
</script>

<style scoped>
.quick-tools {
  background-color: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.section-title {
  font-size: 16px;
  margin-top: 0;
  margin-bottom: 16px;
  color: #333;
  font-weight: 600;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.tool-item {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s;
  padding: 16px 8px;
  border-radius: 8px;
  position: relative;
}

.tool-item:hover {
  transform: translateY(-3px);
  background-color: #f5f5f5;
}

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  color: white;
  font-size: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.tool-name {
  font-size: 14px;
  color: #333;
  text-align: center;
}

.asset-icon {
  background-color: #1976d2;
}

.apply-icon {
  background-color: #4caf50;
}

.material-icon {
  background-color: #ff9800;
}

.outbound-icon {
  background-color: #f44336;
}

.repair-icon {
  background-color: #9c27b0;
}

.transfer-icon {
  background-color: #00bcd4;
}

.analytics-icon {
  background-color: #3f51b5;
}

.category-icon {
  background-color: #009688;
}

.tool-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: #f44336;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

@media (max-width: 768px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
</style> 